<template>
    <div>
        <button @click="setMapName">改变地图名字</button>
    </div>
</template>

<script setup lang="ts">
    import { inject } from 'vue'
    interface MapType {
        name: string
        version: number
        params: string
    }
    const userMap = inject<MapType>('mapKey', {
        name: '',
        version: 0,
        params: '',
    })
    const setMapName = () => {
        userMap.name = '百度'
    }
</script>
<style lang="scss" scoped></style>
